// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require prototype
//= require prototype_ujs
//= require effects
//= require dragdrop
//= require controls
//= require_tree .

function loading() {
  $('loading_msg').show();
}

function loaded() {
  $('loading_msg').hide();
}

// Tratamento de exibicao de mensagens com o mouse sobre uma área
var cX = 0;
var cY = 0;
var rX = 0;
var rY = 0;

function atualizarPosicaoCursor(e) {
  cX = e.pageX;
  cY = e.pageY;
}

function atualizarPosicaoCursorDocAll(e) {
  cX = e.clientX;
  cY = e.clientY;
}

function atribuirPosicao(d) {
  if(self.pageYOffset) {
    rX = self.pageXOffset;
    rY = self.pageYOffset;
  }
  else if(document.documentElement && document.documentElement.scrollTop) {
    rX = document.documentElement.scrollLeft;
    rY = document.documentElement.scrollTop;
  }
  else if(document.body) {
    rX = document.body.scrollLeft;
    rY = document.body.scrollTop;
  }
  
  if(document.all) {
    cX += rX;
    cY += rY;
  }
  
  d.style.left = (cX+10) + "px";
  d.style.top = (cY+10) + "px";
}

function ocultarCaixa(d) {
  if(d.length < 1) { return; }
  document.getElementById(d).style.display = "none";
}

function exibirCaixa(d) {
  if(d.length < 1) { return; }
  var dd = document.getElementById(d);
  atribuirPosicao(dd);
  dd.style.display = "block";
}
